<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文本内容方法</title>
</head>
<body>
    <script src="./js/jquery.min.js"></script>
    <div>
        <div class="test1">
            <h1>hello</h1>
        </div>

        <div>
            <input type="text">
        </div>
    </div>
</body>
<script>
 $(function() {
    console.log( $('.test1').html() );
    $('input').val($('.test1').text());
 })
</script>
</html>